﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace lcps.Web.emailinfo
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                lcps.BLL.tableinfo bt = new BLL.tableinfo();
                ddltables.DataSource = bt.GetAllList().Tables[0];
                ddltables.DataTextField = "tablename";
                ddltables.DataValueField = "id";
                ddltables.DataBind();
            }
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
		

			
			int tableid=int.Parse(this.ddltables.SelectedValue);
			string linkname=this.txtlinkname.Text;
			string ephone=this.txtephone.Text;
			string efax=this.txtefax.Text;

			lcps.Model.emailinfo model=new lcps.Model.emailinfo();
			model.tableid=tableid;
			model.linkname=linkname;
			model.ephone=ephone;
			model.efax=efax;

			lcps.BLL.emailinfo bll=new lcps.BLL.emailinfo();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","list.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
